import goodsList from '../mock/goodsList'

export function queryGoodsList (currentPage = 1, pageSize = 5) {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        status: 0,
        data: goodsList.filter((v, i) => i >= (currentPage - 1) * pageSize && i < pageSize * currentPage),
        pageInfo: {
          current: currentPage,
          pageSize: pageSize,
          total: goodsList.length
        }
      })
    }, 2000)
  })
}